#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

//https://www.nowcoder.com/practice/22e87f8a8d764a6582710f38d1b40c6e?tpId=107&&tqId=33377&rp=1&ru=/ta/beginner-programmers&qru=/ta/beginner-programmers/question-ranking
int main() {
    int N, b[100] = { 0 }, flag = 0;
    scanf("%d", &N);
    for (int i = 0; i < N; i++)
    {
        scanf("%d", &b[i]);
    }
    for (int i = 0; i < N - 1; i++)
    {
        if (b[i] < b[i + 1])
            flag = 1;
        else
        {
            flag = 0;
            break;
        }
    }
    if (flag == 0)
        for (int i = 0; i < N - 1; i++)
        {
            if (b[i] >= b[i + 1])
                flag = 1;
            else
            {
                flag = 0;
                break;
            }
        }
    if (flag)
        printf("sorted");
    else
        printf("unsorted");
    return 0;
}